package com.raymond.queue.codec.encodeing;

import cn.hutool.core.util.ByteUtil;
import com.raymond.queue.common.codec.annotation.MsgCodec;
import com.raymond.queue.common.codec.encodeing.BaseEncoder;
import com.raymond.queue.common.enums.CommandIdType;
import com.raymond.queue.common.msg.BaseMessage;
import com.raymond.queue.common.msg.response.CreateConsumptionResponse;

/**
 * 创建消费组响应编码
 *
 * @author :  raymond
 * @version :  V1.0
 * @date :  2021-07-27 16:35
 */
@MsgCodec(commandId = CommandIdType.CREATE_CONSUMPTION_RESP)
public class CreateConsumptionResponseEncoder extends BaseEncoder {
    @Override
    public byte[] encode0(BaseMessage msg) throws Exception {
        CreateConsumptionResponse createTopicResponse = (CreateConsumptionResponse) msg;
        return ByteUtil.intToBytes(createTopicResponse.getCode());
    }
}
